package com.fr.report.io;

import com.fr.report.RWorkBook;
import com.fr.report.WorkBook;
import com.fr.report.io.core.IOHelper;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

public class ZipTemplateImporter extends AbstractImporter
{
  public WorkBook generateTemplate(InputStream paramInputStream)
    throws Exception
  {
    ZipInputStream localZipInputStream = new ZipInputStream(paramInputStream);
    ZipEntry localZipEntry = localZipInputStream.getNextEntry();
    if ((localZipEntry != null) && ("finereport_cpt".equals(localZipEntry.getName())))
      return IOHelper.generateTemplate(localZipInputStream, "UTF-8");
    return null;
  }

  public RWorkBook generateResult(InputStream paramInputStream)
    throws Exception
  {
    ZipInputStream localZipInputStream = new ZipInputStream(paramInputStream);
    ZipEntry localZipEntry = localZipInputStream.getNextEntry();
    if ((localZipEntry != null) && ("finereport_cpt".equals(localZipEntry.getName())))
      return IOHelper.generateResult(localZipInputStream, "UTF-8");
    return null;
  }
}